package com.suyuan.web;

import java.io.Serializable;
import java.util.List;

/**
 * RESTFUL返回分页数据
 */
public class PageData<T> implements Serializable{

    /**
     * 当前页数
     */
    private Integer pageNum;

    /**
     * 每页数据数量
     */
    private Integer pageSize;

    /**
     * 分页数据
     */
    private List<T> data;

    /**
     * 数据总条数
     */
    private Long totalData;

    /**
     * 总页数
     */
    private Integer totalPage;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Long getTotalData() {
        return totalData;
    }

    public void setTotalData(Long totalData) {
        this.totalData = totalData;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public PageData(){}

    public PageData(Integer pageNum, Integer pageSize, List<T> data, Long totalData, Integer totalPage) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.data = data;
        this.totalData = totalData;
        this.totalPage = totalPage;
    }

    @Override
    public String toString() {
        return "PageData{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", data=" + data +
                ", totalData=" + totalData +
                ", totalPage=" + totalPage +
                '}';
    }
}
